from selenium.common import NoSuchElementException, StaleElementReferenceException
from selenium.webdriver.common.by import By

from base.basepage import PageBase


class PhotoPage(PageBase):
    MEDIA_SELECT_ID = 'iv_local_multi_media_select_index'

    def select_media(self, select_number: int):
        print('选择素材中...')
        print(f'找到素材{len(self.locators([By.ID, self.MEDIA_SELECT_ID]))}个')
        self.loop_click([By.ID, self.MEDIA_SELECT_ID], select_number)
